package core;

import java.io.InputStream;
import java.util.Collection;

import events.LibraryListener;

/**
 * A collection of music.
 * 
 * @author Jason
 * 
 */
public interface MusicLibrary {

	/**
	 * Gets all of the songs in this library.
	 */
	public Collection<Song> getAllMusic();

	/**
	 * Adds the given song to the library.
	 * 
	 * @param song
	 *            The song to add.
	 */
	public void addSong(Song song);

	/**
	 * Removes the given song from the library.
	 */
	public void removeSong(Song song);

	/**
	 * Gets the total number of milliseconds of sound-time that this library
	 * contains.
	 */
	public long getTotalTime();

	/**
	 * Gets the total size in bytes of this library.
	 */
	public long getTotalSize();

	/**
	 * Adds a listener to this library.
	 */
	public void addLibraryListener(LibraryListener listener);

	/**
	 * Removes a listener from this library.
	 */
	public void removeLibraryListener(LibraryListener listener);

	public InputStream getDataFor(Song song);

}
